MAX Billable Metric
Step-by-Step Setup When creating a MAX-based metered feature:-
Navigate to Features
- Go to Product Catalog → Features
- Click “Add Feature”
-
Basic Information
- Name: “Peak Concurrent Users” (or descriptive name)
- Type: Select “Metered”
-
Event Configuration
- Event Name:
concurrent.users
(must match your event data) - Aggregation Function: Max
- Aggregation Field:
user_count
(the property to find maximum for) - Bucket Size: Optional - Leave empty for standard MAX, or select (HOUR, DAY, etc.) for bucketed MAX
- Event Name:
-
Usage Settings
- Usage Reset: Periodic (for peak tracking per period)
- Unit Name:
user / users
- Save Feature
MAX - Two Distinct Modes
MAX aggregation operates in two completely different modes depending on whetherbucket_size
is specified:
Mode 1: Standard MAX (Non-Bucketed)
When:bucket_size
is NOT specifiedReturns: Overall maximum value across all events
Use for: Simple peak detection
Mode 2: Bucketed MAX (Windowed)
When:bucket_size
IS specifiedReturns: Sum of maximum values from each time bucket
Use for: Cumulative peak billing, tiered capacity models
Calculation Examples
Standard MAX Example
Event Data
Standard MAX Calculation
Process: Find the highest value across all eventsResult:
40 users
(maximum from all events)
Bucketed MAX Example
Configuration
- Bucket Size: HOUR
- Slab Pricing:
- 0-5 GB: 0 Rs (free tier)
- 5-10 GB: 2 Rs per GB
- 10+ GB: 3 Rs per GB
Event Data
Calculation Process
Hour 1 (7:00-8:00 UTC):- Events: 8 GB, 4 GB
- Bucket Maximum: 8 GB
- Events: 10 GB, 5 GB, 9 GB
- Bucket Maximum: 10 GB
Tiered Billing Calculation
Billing Calculation for 18 GB total:- First 5 GB: 0 Rs
- Next 5 GB (5-10): 5 × 2 = 10 Rs
- Remaining 8 GB (10-18): 8 × 3 = 24 Rs
- Total: 34 Rs
Use Cases
Standard MAX Use Cases
Peak Concurrent Users
Perfect for: Maximum simultaneous users, peak connectionsPeak Resource Usage
Perfect for: Maximum CPU, peak memory, highest bandwidthBucketed MAX Use Cases
Cumulative Peak Billing
Perfect for: Pay-per-peak hour models, capacity-based pricingInfrastructure Peak Tracking
Perfect for: Peak detection across time windows for billingWhen to Use Each Mode
✅ Use Standard MAX when:- Need simple peak detection
- Billing based on overall maximum
- Single highest value matters
- Cumulative peak billing models
- Time-series peak analysis
- Tiered capacity pricing
- Sum of peaks across time windows
Key Differences
Aspect | Standard MAX | Bucketed MAX |
---|---|---|
Configuration | No bucket_size | Requires bucket_size |
Calculation | Single maximum value | Sum of bucket maximums |
Use Case | Overall peak detection | Cumulative peak billing |
Result | Simple max value | Sum of time-window peaks |
⚠️ Critical Notes
- bucket_size can ONLY be used with MAX aggregation - No other aggregation supports this
- Bucketed MAX sums the maximums - Does NOT return max of maximums
Next Steps
- Creating a Metered Feature - Complete setup guide
- Sending Events - How to transmit MAX events